<!doctype html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>添加客户</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- favicon
		============================================ -->
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/img/favicon.ico}">
    <!-- Google Fonts
		============================================ -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,700,900" rel="stylesheet">
    <!-- Bootstrap CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <!-- Bootstrap CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
    <!-- owl.carousel CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/owl.carousel.css}">
    <link rel="stylesheet" th:href="@{/css/owl.theme.css}">
    <link rel="stylesheet" th:href="@{/css/owl.transitions.css}">
    <!-- animate CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/animate.css}">
    <!-- normalize CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/normalize.css}">
    <!-- meanmenu icon CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/meanmenu.min.css}">
    <!-- main CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/main.css}">
    <!-- educate icon CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/educate-custon-icon.css}">
    <!-- morrisjs CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/morrisjs/morris.css}">
    <!-- mCustomScrollbar CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/scrollbar/jquery.mCustomScrollbar.min.css}">
    <!-- metisMenu CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/metisMenu/metisMenu.min.css}">
    <link rel="stylesheet" th:href="@{/css/metisMenu/metisMenu-vertical.css}">
    <!-- calendar CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/calendar/fullcalendar.min.css}">
    <link rel="stylesheet" th:href="@{/css/calendar/fullcalendar.print.min.css}">
    <!-- forms CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/form/all-type-forms.css}">
    <!-- dropzone CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/dropzone/dropzone.css}">
    <!-- style CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <!-- responsive CSS
		============================================ -->
    <link rel="stylesheet" th:href="@{/css/responsive.css}">

    <style>
        .file {
            position: relative;
            display: inline-block;
            background: rgb(0, 109, 240);
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: white;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            /*
            background: #AADFFD;
            border-color: #78C3F3;
*/
            color: white;
            /*            text-decoration: none;*/
        }
    </style>
    <!-- modernizr JS
		============================================ -->
    <script th:src="@{/js/vendor/modernizr-2.8.3.min.js}"></script>
</head>

<body>
    <!--[if lt IE 8]>
		<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
	<![endif]-->
    <!-- Start Left menu area -->
    <div th:insert="~{/sideBar::sideBar}"></div>
    <!-- End Left menu area -->
    <!-- Start Welcome area -->
    <div class="all-content-wrapper">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="logo-pro">
                        <a href="index.html"><img class="main-logo" th:src="@{/img/logo/logo.png}" alt="" /></a>
                    </div>
                </div>
            </div>
        </div>
        <div th:insert="~{/top::topBar}"></div>
        <!-- Single pro tab review Start-->
        <div class="single-pro-review-area mt-t-30 mg-b-15">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="product-payment-inner-st">
                            <ul id="myTabedu1" class="tab-review-design">
                                <li class="active"><a href="#description">基本信息</a></li>
                            </ul>
                            <div id="myTabContent" class="tab-content custom-product-edit">
                                <div class="product-tab-list tab-pane fade active in" id="description">
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <div class="review-content-section">
                                                <div id="dropzone1" class="pro-ad">
                                                    <form id="upload"
                                                          style="display: flex;flex-direction: row;flex-wrap: wrap;width: 100%">
                                                        <div style="display: flex;flex-direction: column;width: 50%;padding-right: 1%">
                                                            <div style="margin-top: 30px">
                                                                <input name="name" type="text" class="form-control" placeholder="姓名">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="birth" type="text" class="form-control" placeholder="出生日期">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="clientId" type="number" th:value="${clientId}" disabled="disabled" class="form-control" placeholder="编号">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="address" type="text" class="form-control" placeholder="地址">
                                                            </div>
                                                            <div style="width: 100%;margin-top: 10px">
                                                                <a href="javascript:;" class="file">添加照片
                                                                    <input type="file" name="file" id="chooseImg">
                                                                </a><br>
                                                                <img id="cropedBigImg" value='custom' alt="lorem ipsum dolor sit" data-address='' style="display: none;width: 30%;margin-left: 35%;border-radius: 5px" />
                                                            </div>
                                                        </div>
                                                        <div style="display: flex;flex-direction: column;width: 50%;padding-left: 1%">
                                                            <div style="margin-top: 30px">
                                                                <select name="gender" class="form-control">
                                                                    <option value="none" selected="" disabled="">性别</option>
                                                                    <option value="0">男</option>
                                                                    <option value="1">女</option>
                                                                </select>
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="phoneNum" type="text" class="form-control" placeholder="手机号">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="room" type="text" class="form-control" placeholder="房号">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="family" type="text" class="form-control" placeholder="家属">
                                                            </div>
                                                            <div style="margin-top: 10px">
                                                                <input name="familyPhone" type="text" class="form-control" placeholder="家属联系方式">
                                                            </div>
                                                            <div class="form-group res-mg-t-15" style="margin-top: 10px">
                                                                <textarea name="medicalHistory" placeholder="过往病例"></textarea>
                                                            </div>
                                                        </div>

                                                        <div style="width: 100%;text-align: center;margin-top: 20px">
                                                            <input value="提 交" class="btn btn-primary waves-effect waves-light" style="width: 8%" onclick="submitFunction()">
                                                        </div>

                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div th:insert="~{/footer::footer}"></div>
    </div>

    <!-- jquery
		============================================ -->
    <script th:src="@{/js/vendor/jquery-1.12.4.min.js}"></script>
    <!-- bootstrap JS
		============================================ -->
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <!-- wow JS
		============================================ -->
    <script th:src="@{/js/wow.min.js}"></script>
    <!-- price-slider JS
		============================================ -->
    <script th:src="@{/js/jquery-price-slider.js}"></script>
    <!-- meanmenu JS
		============================================ -->
    <script th:src="@{/js/jquery.meanmenu.js}"></script>
    <!-- owl.carousel JS
		============================================ -->
    <script th:src="@{/js/owl.carousel.min.js}"></script>
    <!-- sticky JS
		============================================ -->
    <script th:src="@{/js/jquery.sticky.js}"></script>
    <!-- scrollUp JS
		============================================ -->
    <script th:src="@{/js/jquery.scrollUp.min.js}"></script>
    <!-- mCustomScrollbar JS
		============================================ -->
    <script th:src="@{/js/scrollbar/jquery.mCustomScrollbar.concat.min.js}"></script>
    <script th:src="@{/js/scrollbar/mCustomScrollbar-active.js}"></script>
    <!-- metisMenu JS
		============================================ -->
    <script th:src="@{/js/metisMenu/metisMenu.min.js}"></script>
    <script th:src="@{/js/metisMenu/metisMenu-active.js}"></script>
    <!-- morrisjs JS
		============================================ -->
    <script th:src="@{/js/sparkline/jquery.sparkline.min.js}"></script>
    <script th:src="@{/js/sparkline/jquery.charts-sparkline.js}"></script>
    <!-- calendar JS
		============================================ -->
    <script th:src="@{/js/calendar/moment.min.js}"></script>
    <script th:src="@{/js/calendar/fullcalendar.min.js}"></script>
    <script th:src="@{/js/calendar/fullcalendar-active.js}"></script>
    <!-- maskedinput JS
		============================================ -->
    <script th:src="@{/js/jquery.maskedinput.min.js}"></script>
    <script th:src="@{/js/masking-active.js}"></script>
<!--    &lt;!&ndash; datepicker JS-->
<!--		============================================ &ndash;&gt;-->
<!--    <script th:src="@{/js/datepicker/jquery-ui.min.js}"></script>-->
<!--    <script th:src="@{/js/datepicker/datepicker-active.js}"></script>-->
<!--    &lt;!&ndash; form validate JS-->
<!--		============================================ &ndash;&gt;-->
<!--    <script th:src="@{/js/form-validation/jquery.form.min.js}"></script>-->
<!--    <script th:src="@{/js/form-validation/jquery.validate.min.js}"></script>-->
<!--    <script th:src="@{/js/form-validation/form-active.js}"></script>-->

    <script>
        function submitFunction() {
            //这里唯一需要注意的就是这个form-add的id
            var formData = new FormData($("#upload")[0]);
            formData.set("clientId",$(" input[ name='clientId' ]").val());
            $.ajax({
                //接口地址
                url: '/uploadclient',
                type: 'POST',
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (data) {
                    console.log(data)
                    //成功的回调
                    if (data.code === 300) {
                        console.log(data)
                    }

                },
                error: function (returndata) {
                    //请求异常的回调window.event.returnValue = false;
                    // modals.warn("网络访问失败，请稍后重试!");
                }
            });
            location.reload();
        }
        $('#chooseImg').on('change', function() {
            var filePath = $(this).val(), //获取到input的value，里面是文件的路径
                fileFormat = filePath.substring(filePath.lastIndexOf(".")).toLowerCase(),
                src = window.URL.createObjectURL(this.files[0]); //转成可以在本地预览的格式
            // 检查是否是图片
            if (!fileFormat.match(/.png|.jpg|.jpeg/)) {
                error_prompt_alert('上传错误,文件格式必须为：png/jpg/jpeg');
                return;
            }

            $('#cropedBigImg').attr('src', src);
            $('#cropedBigImg').css("display","");
        });
    </script>
    <!-- dropzone JS
		============================================ -->

    <!-- tab JS
		============================================ -->
    <script th:src="@{/js/tab.js}"></script>
    <!-- plugins JS
		============================================ -->
    <script th:src="@{/js/plugins.js}"></script>
    <!-- main JS
		============================================ -->
    <script th:src="@{/js/main.js}"></script>
    <script th:src="@{/js/myjs/reload.js}"></script>

    <!-- tawk chat JS
		============================================ -->
<!--    <script th:src="@{/js/tawk-chat.js}"></script>-->
</body>

</html>